﻿using System;
using System.Collections.Generic;
using Opalis.QuickIntegrationKit;
using Microsoft.Exchange.WebServices.Data;
using Microsoft.Exchange.WebServices.Autodiscover;
using System.Text;
using System.Net;

namespace ExchangeMail
{
    [OpalisData("Email")]
    public class Email
    {
        private String subject = String.Empty;
        private String body = String.Empty;
        private String from = String.Empty;
        private String id = String.Empty;
        private Boolean Attachements = false;
        private DateTime recievedDate = new DateTime();

        internal Email(String subject, String body, String from, String id, DateTime recievedDate, Boolean attachments)
        {
            this.subject = subject;
            this.body = body;
            this.from = from;
            this.id = id;
            this.recievedDate = recievedDate;
            this.Attachements = attachments;
        }

        internal Email(String subject, String body, String from, String id, DateTime recievedDate)
        {
            this.subject = subject;
            this.body = body;
            this.from = from;
            this.id = id;
            this.recievedDate = recievedDate;
        }

        internal Email(String subject, String body, String from, String id)
        {
            this.subject = subject;
            this.body = body;
            this.from = from;
            this.id = id;
        }
        internal Email(String subject, String body, String from)
        {
            this.subject = subject;
            this.body = body;
            this.from = from;
        }
        internal Email(String subject, String from)
        {
            this.subject = subject;
            this.from = from;
        }
        [OpalisOutput, OpalisFilter]
        public Boolean attachments
        {
            get { return Attachements; }
        }

        [OpalisOutput, OpalisFilter]
        public String Subject
        {
            get { return subject; }
        }

        [OpalisOutput, OpalisFilter]
        public String Body
        {
            get { return body; }
        }

        [OpalisOutput, OpalisFilter]
        public String From
        {
            get { return from; }
        }
        [OpalisOutput, OpalisFilter]
        public String Id
        {
            get { return id; }
        }
        [OpalisOutput, OpalisFilter]
        public DateTime ReceivedDate
        {
            get { return recievedDate; }
        }
    }
}
